import { createRouter, createWebHistory } from 'vue-router'
import layout from '../components/index.vue'

const routes = [
    {
        path: '/',
        name: '/',
        component: layout,
        redirect: '/home',
        children: [
            {
                name: 'home',
                path: '/home',
                title: '首页',
                component: () => import('../view/home/home.vue')
            },
            {
                name: 'product',
                path: '/product',
                title: '产品管理',
                component: () => import('../view/product/index.vue'),
                children:[
                    {
                        name: 'product',
                        path: '/product',
                        component: () => import('../view/product/product.vue'),
                    },
                    {
                        name: 'classification',
                        path: '/classification',
                        component: () => import('../view/product/classification.vue'),
                    },
                    {
                        name: 'grouping',
                        path: '/grouping',
                        component: () => import('../view/product/grouping.vue'),
                    },
                    {
                        name: 'comment',
                        path: '/comment',
                        component: () => import('../view/product/comment.vue'),
                    },
                    {
                        name: 'Specifications',
                        path: '/Specifications',
                        component: () => import('../view/product/Specifications.vue'),
                    },
                ]
            },
            {
                name: 'store',
                path: '/store',
                title: '门店管理',
                component: () => import('../view/store/index.vue'),
                children:[
                    {
                        name: 'store',
                        path: '/store',
                        component: () => import('../view/store/store.vue')
                    },
                    {
                        name: 'delivery',
                        path: '/delivery',
                        component: () => import('../view/store/delivery.vue')
                    },
                    {
                        name: 'freight',
                        path: '/freight',
                        component: () => import('../view/store/freight.vue')
                    },
                    {
                        name: 'Rotation',
                        path: '/Rotation',
                        component: () => import('../view/store/Rotation.vue')
                    },
                    {
                        name: 'search',
                        path: '/search',
                        component: () => import('../view/store/search.vue')
                    },
                ]
            },
            {
                name: 'member',
                path: '/member',
                title: '会员管理',
                component: () => import('../view/member/member.vue'),
                children:[
                    {
                        name: 'member',
                        path: '/member',
                        component: () => import('../view/member/member.vue')
                    },
                ]
            },
            {
                name: 'order',
                path: '/order',
                title: '订单管理',
                component: () => import('../view/order/order.vue'),
                children:[
                    {
                        name: 'order',
                        path: '/order',
                        component: () => import('../view/order/order.vue')
                    },
                ]
            },
            {
                name: 'system',
                path: '/system',
                title: '系统管理',
                component: () => import('../view/system/index.vue'),
                children:[
                    {
                        name: 'address',
                        path: '/address',
                        component: () => import('../view/system/address.vue')
                    },
                    {
                        name: 'administrators',
                        path: '/administrators',
                        component: () => import('../view/system/administrators.vue')
                    },
                    {
                        name: 'role',
                        path: '/role',
                        component: () => import('../view/system/role.vue')
                    },
                    {
                        name: 'menu',
                        path: '/menu',
                        component: () => import('../view/system/menu.vue')
                    },
                    {
                        name: 'timing',
                        path: '/timing',
                        component: () => import('../view/system/timing.vue')
                    },
                    {
                        name: 'parameter',
                        path: '/parameter',
                        component: () => import('../view/system/parameter.vue')
                    },
                    {
                        name: 'system',
                        path: '/system',
                        component: () => import('../view/system/system.vue')
                    },
                ]
            },
        ]
    },



];
const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router